using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Royaltyset : IAccessible<T_Royaltyset, Royaltyset>, ILogicEntity<T_Royaltyset, Royaltyset>
    {
        public int ID { get; set; }

        public string LevelName { get; set; }

        public decimal StartSales { get; set; }

        public decimal EndSales { get; set; }

        public decimal RoyaltyRate { get; set; }

        protected override void Covariant(T_Royaltyset model)
        {
            if (model != null)
            {
                    this.ID = model.ID;
                    this.LevelName = model.LevelName;
                    this.StartSales = model.StartSales;
                    this.EndSales = model.EndSales;
                    this.RoyaltyRate = model.RoyaltyRate;
            }
}
        protected override T_Royaltyset Inverter(Royaltyset model)
        {
            if (model != null)
            {
                return new T_Royaltyset()
                {
                    ID = model.ID,
                    LevelName = model.LevelName,
                    StartSales = model.StartSales,
                    EndSales = model.EndSales,
                    RoyaltyRate = model.RoyaltyRate,
                };
            }
            return null;
        }
        public Royaltyset Set(T_Royaltyset dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
